home *** CD-ROM | disk | FTP | other *** search
/ Software 2000 / Software 2000 Volume 1 (Disc 1 of 2).iso / utilities / u513.dms / in.adf / AnimTools / StrpAnim / Chain.script < prev    next >
Encoding:
Text File  |  1990-06-25  |  2.5 KB  |  76 lines

  1.  
  2. rem  A Director script
  3. rem  example of preloading and chaining 2 DPaint III anims together
  4. rem  in a continuous loop.
  5.  
  6.         setblack 1              :rem  under cover of darkness
  7.  
  8. REM  load first frames of the anims into fast ram
  9.         loadfast 10,"anim1"       :rem  load anim 1 first frame
  10.         loadfast 11,"anim2"       :rem  load anim 2 first frame
  11.  
  12. REM load the anims
  13.         loadanim 21,"anim1"
  14.         loadanim 22,"anim2"
  15.  
  16. REM now initialize variables
  17.         animbuf = 1             :rem  next frame buffer
  18.         animdone=0
  19.         anima=1                 :rem  buffers used for double buffering
  20.         animb=2
  21.         speed 1
  22.         rem position -1,-1      :rem  use if anims are overscan
  23.         fade 1,-1,0
  24.  
  25. REM ok, now loop
  26. 100
  27.         animdat=21              :rem  use first anim data
  28.         new animbuf,10          :rem  make the second buffer
  29.         copy 10,animbuf         :rem  copy first frame pic into buffer 2
  30.         gosub 9102              :rem  display the buffer
  31.         new animbuf,-1          :rem  build 2nd buffer
  32.         copy -1,animbuf
  33.  
  34.         gosub 9101      :rem  skip pause, to help compensate for time lost
  35.         for i=3 to 32           :rem  for a 32 frame anim
  36.                 gosub 9100
  37.         next
  38.  
  39.         gosub 9200      :rem  reset anim for next time
  40.  
  41.         animdat=22              :rem  first anim data
  42.         new animbuf,11          :rem  make the second buffer
  43.         copy 11,animbuf         :rem  copy first frame pic into buffer 2
  44.         gosub 9102              :rem  display it
  45.         new animbuf,-1          :rem  rebuild 2nd buffer
  46.         copy -1,animbuf
  47.  
  48.         gosub 9101    :rem  skip the pause, to help compensate for time lost
  49.         for i=3 to 25           :rem  for a 25 frame anim
  50.                 gosub 9100
  51.         next
  52.  
  53.         gosub 9200
  54.         goto 100
  55.  
  56.  
  57. rem     do next frame in the anim:
  58. 9100 pause 0    :rem  frame pause (if any)
  59. 9101 if animdone        :rem  skip if looping and at first frame
  60.       skipanim animdat,animbuf,animg,animd,animdone
  61.    endif
  62.    anim animdat,animbuf,animg,animd,animdone
  63.  
  64. 9102    :rem  do the buffer swap
  65.    display animbuf
  66.    display animbuf      :rem  elimiate flickering on faster (68020) machines
  67.    animbuf=(anima+animb)-animbuf
  68.    return
  69.  
  70. rem  reset an anim so that next time it's played it starts from the beginning
  71. 9200
  72.         if animdone:animdone = 0:return:endif   :rem  if at end, return
  73.         skipanim animdat,animbuf,animg,animd,animdone
  74.         goto 9200       :rem  skip until end
  75.  
  76.